luci-app-wol: Show powered off hosts in dropdown menu
authorAlvaro Ollero <[email protected]>
Thu, 15 May 2025 16:42:15 +0000 (18:42 +0200)
committerPaul Donald <[email protected]>
Tue, 20 May 2025 17:15:14 +0000 (20:15 +0300)
Signed-off-by: Alvaro Ollero <[email protected]>
applications/luci-app-wol/htdocs/luci-static/resources/view/wol.js

index 17f7ee453f15efa3eebaa1ee3492e4a99bf9c7f9..29b0d305aa2fbdb5caf0557d5f45137b52724cd4 100644 (file)
@@ -57,6 +57,15 @@ return view.extend({
                        o.noaliases = true;
                        o.noinactive = true;
 
+                       uci.sections('etherwake', 'target', function(section) {
+                               if (section.mac && section.name) {
+                                       // Create a host entry if it doesn't exist
+                                       if (!hosts[section.mac]) {
+                                               hosts[section.mac] = { name: section.name };
+                                       }
+                               }
+                       });
+
                        if (has_wol)
                                o.depends('executable', '/usr/bin/etherwake');
                }